Current Location: Home> Function Categories> max

max

Find the maximum value
Name:max
Category:math
Programming Language:php
One-line Description:Returns the maximum value.

Definition and usage

max() returns the maximum value.

Example

In this example, we will use max() to return the maximum value of the two specified numbers:

 <?php
echo ( max ( 5 , 7 ) ) ;
echo ( max ( - 3 , 5 ) ) ;
echo ( max ( - 3 , - 5 ) ) ;
echo ( max ( 7.25 , 7.30 ) ) ;
?>

Try it yourself

grammar

 max ( x , y )
parameter describe
x Required. A number.
y Required. A number.

illustrate

max() returns the maximum value in the parameter.

If there is only one parameter and is an array, max() returns the largest value in the array. If the first parameter is an integer, string, or floating point number, at least two parameters are required and max() returns the largest of these values. An infinite number of values ​​can be compared.

Similar Functions
  • Exponential expressions pow

    pow

    Exponentialexpressio
  • Returns the remainder of the floating point number of division fmod

    fmod

    Returnstheremaindero
  • Round the division result intdiv

    intdiv

    Roundthedivisionresu
  • Further method to sort ceil

    ceil

    Furthermethodtosort
  • Hyperbolic cosine cosh

    cosh

    Hyperboliccosine
  • Leave the method of sorting floor

    floor

    Leavethemethodofsort
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
Popular Articles